package com.tim.app.server.entry;

import android.text.TextUtils;

import com.tim.app.constant.AppKey;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 问题
 */
public class Problem extends BaseObject implements Serializable {

    private static final long serialVersionUID = -485417149352074675L;

    private boolean isChecked;

    private String content;//内容

    private String digest;//简介

    private String topicTitle;//话题名称

    private String topicDesc;//话题简介

    private String platform;

    private String topicIds;

    private String userId;

    private List<Topic> topicList;

    private int isAnonymous;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<Topic> getTopicList() {
        return topicList;
    }

    public void setTopicList(List<Topic> topicList) {
        this.topicList = topicList;
    }

    public String getTopicTitle() {
        return topicTitle;
    }

    public void setTopicTitle(String topicTitle) {
        this.topicTitle = topicTitle;
    }


    public String getTopicDesc() {
        return topicDesc;
    }

    public void setTopicDesc(String topicDesc) {
        this.topicDesc = topicDesc;
    }

    public String getPlatform() {
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }

    public String getTopicIds() {
        return topicIds;
    }

    public void setTopicIds(String topicIds) {
        this.topicIds = topicIds;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getIsAnonymous() {
        return isAnonymous;
    }

    public void setIsAnonymous(int isAnonymous) {
        this.isAnonymous = isAnonymous;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public List<String> getImageUrl() {
        if (!TextUtils.isEmpty(getImage())) {
            if (getImage().contains(AppKey.SEPARATOR)) {
                return Arrays.asList(getImage().split(AppKey.SEPARATOR));
            } else {
                List<String> list = new ArrayList<>();
                list.add(getImage());
                return list;
            }
        }
        return null;
    }

}
